<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="container-div">

		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="data-form">
					<div class="select-list">
						<ul>
							<li>
								项目名称：<input type="text" name="pvobName" id="pvobName"/>
							</li>
							<li>
								开发流：<input type="text" name="devStream" id="devStream"/>
							</li>

							<li><a class="btn btn-primary btn-rounded btn-sm"
								onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm"
								id="resetCondition"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>

			<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add()"
					shiro:hasPermission="rtms:devVersionContrl:add"> <i
					class="fa fa-plus"></i> 添加
				</a>
				<!-- 			<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="rtms:devVersionContrl:edit"> -->
				<!-- 	            <i class="fa fa-edit"></i> 修改 -->
				<!-- 	        </a> -->
				<!-- 			<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="rtms:devVersionContrl:remove"> -->
				<!-- 				<i class="fa fa-remove"></i> 删除 -->
				<!-- 			</a> -->
				<!-- 			<a class="btn btn-info disabled" onclick="$.operate.edit()" shiro:hasPermission="rtms:devVersionContrl:edit"> -->
				<!-- 				<i class="fa fa-edit"></i> 解锁流 -->
				<!-- 			</a> -->
				<!-- 			<a class="btn btn-warning disabled" onclick="$.operate.edit()" shiro:hasPermission="rtms:devVersionContrl:edit"> -->
				<!-- 				<i class="fa fa-edit"></i> 锁流 -->
				<!-- 			</a> -->

				<a class="btn btn-primary btn-edit" onclick="$.operate.edit()"
					shiro:hasPermission="rtms:devVersionContrl:edit"> <i
					class="fa fa-edit"></i> 修改
				</a> <a class="btn btn-danger btn-del btn-del"
					onclick="$.operate.removeAll()"
					shiro:hasPermission="rtms:devVersionContrl:remove"> <i
					class="fa fa-remove"></i> 删除
				</a> <a class="btn btn-info"
					onclick="$.operate.editClock('确定对开发流进行解锁流操作，解锁需要等待一段时间，解锁完成后会有提示？')"
					shiro:hasPermission="rtms:devVersionContrl:edit"> <i
					class="fa fa-edit"></i> 解锁流
				</a> <a class="btn btn-warning"
					onclick="$.operate.editClock('确定对开发流进行锁流操作，锁流需要等待一段时间，锁流完成后会有提示?')"
					shiro:hasPermission="rtms:devVersionContrl:edit"> <i
					class="fa fa-edit"></i> 锁流
				</a> <a class="btn btn-primary" onclick="$.operate.genbaseline()"
					shiro:hasPermission="rtms:devVersionContrl:edit"> <i
					class="fa fa-edit"></i> 生成基线
				</a> <a class="btn btn-success" onclick="$.operate.edit()"
					shiro:hasPermission="rtms:devVersionContrl:edit"> <i
					class="fa fa-edit"></i> 复制
				</a>
			</div>

			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
		<div th:include="include :: footer"></div>
		<script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('rtms:devVersionContrl:edit')}]];
        var removeFlag = [[${@permission.hasPermi('rtms:devVersionContrl:remove')}]];
        var prefix = ctx + "rtms/devVersionContrl";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                genbaselineUrl:prefix + "/genbaseline",
                queryParams: queryParams,
                sortName: "createTime",
		        sortOrder: "desc",
                modalName: "版本开发流管理",
                columns: [{
		            checkbox: true
		        },
				{
					field : 'devVersionId', 
					title : '主键ID' 
				},
				{
					field : 'devStream', 
					title : '开发流' 
				},
				{
					field : 'devViewAccount', 
					title : '下载更新视图开发人员账号' 
				},
				/**
				{
					field : 'devViewPwd', 
					title : '下载更新视图开发人员密码' 
				},*/
				{
					field : 'ccManagerAccount', 
					title : 'cc管理员账号' 
				},
				/**
				{
					field : 'ccManagerPwd', 
					title : 'cc管理员密码' 
				},*/
				{
					field : 'pvobName', 
					title : 'PVOB名称' 
				},
				{
					field : 'remoteViewName', 
					title : '远程视图名称' 
				},
				{
					field : 'versionStatus', 
					title : '版本状态' 
				},
				{
					field : 'createTime', 
					title : '生成记录时间' 
				},
				{
					field : 'lastUpdateTime', 
					title : '更新记录时间' 
				},
				{
					field : 'remark', 
					title : '备注' 
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.devVersionId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.devVersionId + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });

        function queryParams(params) {
			return {
				pvobName:       $("#pvobName").val(),
				devStream:       $("#devStream").val(),
				pageSize:       params.limit,
    			pageNum:        params.offset / params.limit + 1,
    			searchValue:    params.search,
    			orderByColumn:  params.sort,
    		isAsc:          params.order
			};
		}
        
		$("#resetCondition").click(function(){
			$("#devStream").html('');
			$("#pvobName").html('');
		});
    </script>
</body>
</html>